<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>数据管理</title>

    <link rel="stylesheet" href="/bus/js/css/layui.css" media="all">
    <link rel="stylesheet" href="/bus/upDataMain/style.css?t=1617720346170" media="all">

    <style>
    </style>

</head>

<body id="mybody">

<!--------------------主数据搜索表单------------------------->
<!--------------------主数据搜索表单------------------------->
<form class="layui-form">

    <div class="searchTable">
        搜索：
        <div class="layui-inline my-inline">
            <input class="layui-input" name="id" placeholder="id" autocomplete="off">
        </div>


        <div class="layui-inline my-inline">
            <input class="layui-input" name="parent_id" placeholder="parent_id" autocomplete="off" id="parent_id">
        </div>

        <div class="layui-inline my-inline2">
            <input class="layui-input" name="upDataMain.title" placeholder="title" autocomplete="off">
        </div>
        <div class="layui-inline my-inline2">
            <input class="layui-input" name="content" placeholder="content" autocomplete="off">
        </div>

        <div class="layui-inline my-inline2">
            <input class="layui-input" name="busDateStr" placeholder="busDateStr" autocomplete="off">
        </div>
        <div class="layui-inline">
            <input class="layui-input" name="keyValues" placeholder="keyValues" autocomplete="off">
        </div>


        <div class="layui-inline my-inline">
            <select name="category01" lay-search="" id="category01s" lay-filter="category01">
                <option value=""></option>
                <option value="待定">待定</option>
                <option th:each="Module,userStat:${webModules}" th:id="${Module.dvalue}" th:myid="${Module.id}"
                        th:value="${Module.dvalue}" th:text="${Module.dkey}">name
                </option>
            </select>
        </div>

        <div class="layui-inline my-inline">
            <select name="category02" lay-search="" id="category02" lay-filter="category02">
                <option value="" selected></option>
                <option value="待定">待定</option>
            </select>
        </div>

        <div class="layui-inline my-inline">
            <select name="category03" lay-search="" id="category03" lay-filter="category03">
                <option value="" selected></option>
                <option value="待定">待定</option>
            </select>
        </div>

        <button type="reset" class="layui-btn layui-btn-primary">清空</button>
        <button class="layui-btn" lay-submit lay-filter="submitBtn2" id="submitBtn2" data-type="reload">搜索</button>


        <div class="layui-inline my-inline" id="searchmaina">
            <select name="rangeTypes" lay-search="" lay-filter="rangeTypes" id="rangeTypes">
                <option value="" selected></option>
                <option value="more">more</option>
                <option value="less">less</option>
                <option value="mole">mole</option>
            </select>
        </div>

        <div class="layui-inline my-inline" id="searchmainb">
            <select name="rangeFields" lay-search="" lay-filter="rangeFields" id="rangeFields">
                <option value="" selected></option>
                <option value="version">version</option>
                <option value="score">score</option>
                <option value="createDate">createDate</option>
                <option value="busDate">busDate</option>
                <option value="lastUpdateDate">lastUpdateDate</option>
                <option value="id">id</option>

            </select>
        </div>

        <div class="layui-inline my-big-inline" id="searchmainc">
            <input class=" layui-input" name="rangeStrs" placeholder="rangeStrs" autocomplete="off" id="rangeStrs">
        </div>


        <div id="searchmain2" class="layui-inline my-big-inline"></div>

    </div>
</form>
<!--------------------主数据搜索表单-------------------------->
<!--------------------主数据搜索表单-------------------------->
<!---------------------主数据列表---------------------------->
<!---------------------主数据列表---------------------------->
<table class="layui-table" lay-data="{url:'', id:'tmlist',height: 480,toolbar:'default'}" lay-filter="tmlist">
    <!--分页-->
    <div id="mylaypage"></div>
    <thead>
    <tr>
        <th lay-data="{type:'checkbox'}">ID</th>
        <th lay-data="{field:'id', width:80, sort: true}">ID</th>
        <th lay-data="{field:'title', width:210, sort: true, edit: 'text'}">名称</th>
        <th lay-data="{field:'content', sort: true,edit: 'text', minWidth: 210}">描述</th>


        <th lay-data="{field:'category01',sort: true, edit: 'text', width:80}">一级</th>
        <th lay-data="{field:'category02',sort: true, edit: 'text', width:80}">二级</th>
        <th lay-data="{field:'category03',sort: true,  edit: 'text',width:80}">三级</th>

        <th lay-data="{field:'keyValues',sort: true, edit: 'text', width:180}">keyValues</th>
        <th lay-data="{field:'version', sort: true, width:80}">version</th>


        <th lay-data="{field:'score', sort: true, edit: 'text', width:80}">score</th>
        <th lay-data="{field:'links',  sort: true,edit: 'text', width:80}">links</th>
        <th lay-data="{field:'descmap',sort: true,  edit: 'text', width:80}">descmap</th>

        <th lay-data="{field:'busDate', sort: true,maxWidth: 50, width:200}">设置时间</th>
        <th lay-data="{field:'createDate', sort: true,maxWidth: 50, width:200}">创建时间</th>
        <th lay-data="{field:'lastUpdateDate', sort: true,maxWidth: 50, width:200}">修改时间</th>


        <th lay-data="{field:'parent_id', sort: true, edit: 'text', width:80}">pid</th>
        <th lay-data="{field:'sortx', sort: true, edit: 'text'}">排序</th>

        <th lay-data="{field:'categoryNum',sort: true,  edit: 'text', width:80}">数级</th>

        <th lay-data="{fixed: 'right', width:178, align:'center', toolbar: '#barOption'}"></th>
    </tr>
    </thead>
</table>
<!---------------------------------主数据列表------------------------------>
<!---------------------------------主数据列表------------------------------>


<!-------------------------------tab-------------------------------->
<!-------------------------------tab-------------------------------->
<div class="layui-tab layui-tab-brief" lay-filter="demo">
    <ul class="layui-tab-title">
        <li class="layui-this">子节点</li>
        <li>图片</li>
        <li>文件</li>
        <li>上传</li>
        <li>其他</li>
    </ul>

    <!----------------------------tab内容-------------------------------->
    <div class="layui-tab-content">

        <!--------------------------子数据-列表--------------------------->
        <!--------------------------子数据-列表--------------------------->
        <div class="layui-tab-item layui-show">
            <table class="layui-table" lay-data="{url:'', id:'tmdlist',height: 480,toolbar:'default'}"
                   lay-filter="tmdlist">
                <thead>
                <tr>
                    <th lay-data="{type:'checkbox'}">ID</th>
                    <th lay-data="{field:'id', width:80, sort: true}">ID</th>
                    <th lay-data="{field:'parent_id',  edit: 'text', width:80}">pid</th>
                    <th lay-data="{field:'title', width:200, sort: true, edit: 'text'}">名称</th>
                    <th lay-data="{field:'content', edit: 'text', minWidth: 150}">描述</th>

                    <th lay-data="{field:'categoryNum',  edit: 'text', width:80}">数级</th>
                    <th lay-data="{field:'category01', edit: 'text', width:80}">一级</th>
                    <th lay-data="{field:'category02', edit: 'text', width:80}">二级</th>
                    <th lay-data="{field:'category03',  edit: 'text',width:80}">三级</th>

                    <th lay-data="{field:'keyValues', edit: 'text', width:180}">keyValues</th>
                    <th lay-data="{field:'version',  width:80}">version</th>


                    <th lay-data="{field:'score',  edit: 'text', width:80}">score</th>
                    <th lay-data="{field:'links',  edit: 'text', width:80}">links</th>
                    <th lay-data="{field:'descmap',  edit: 'text', width:80}">descmap</th>

                    <th lay-data="{field:'busDate', sort: true,maxWidth: 50, width:200}">设置时间</th>
                    <th lay-data="{field:'createDate', sort: true,maxWidth: 50, width:200}">创建时间</th>
                    <th lay-data="{field:'lastUpdateDate', sort: true,maxWidth: 50, width:200}">修改时间</th>


                    <th lay-data="{field:'sortx', sort: true, edit: 'text'}">排序</th>
                    <th lay-data="{fixed: 'right', width:178, align:'center', toolbar: '#barOptionDetail'}"></th>
                </tr>
                </thead>
            </table>
        </div>
        <!--------------------------子数据-列表--------------------------->
        <!--------------------------子数据-列表--------------------------->

        <!--------------------------子数据-图片-列表--------------------------->
        <!--------------------------子数据-图片-列表--------------------------->
        <div class="layui-tab-item">
            <!--            style="height: 300px;"-->
            <div class="layui-inline ">
                <input class="layui-input" placeholder="imgListShowheight" id="imgListShowHeight" value="800"
                       autocomplete="off">
            </div>

            <div class="layui-inline ">
                <input class="layui-input" placeholder="imgShowWidth" Width id="imgShowWidth" value="230"
                       autocomplete="off">
            </div>

            <div class="layui-inline ">
                <input class="layui-input" placeholder="imgShowHeight" id="imgShowHeight" value="150"
                       autocomplete="off">
            </div>

            <ul class="flow-default amplifyImg" style="height: 800px;overflow: auto;" id="imgListShow">
            </ul>

            <!--数据列表-->
            <table class="layui-table" lay-data="{url:'', id:'imglist',toolbar:'default'}" lay-filter="imglist">
                <thead>
                <tr>
                    <th lay-data="{type:'checkbox'}">ID</th>
                    <th lay-data="{field:'id', width:80, sort: true}">ID</th>
                    <th lay-data="{field:'name', width:200, sort: true, edit: 'text'}">名称</th>
                    <th lay-data="{field:'content', edit: 'text', minWidth: 150}">描述</th>
                    <th lay-data="{field:'videourl',  minWidth: 200,edit: 'text'}">videourl</th>
                    <th lay-data="{field:'type', minWidth: 100}">类型</th>
                    <th lay-data="{field:'size', minWidth: 100}">size</th>
                    <th lay-data="{field:'dir',  minWidth: 120}">路径</th>
                    <th lay-data="{field:'createdate', sort: true,maxWidth: 50, width:200}">创建时间</th>
                    <th lay-data="{field:'sortx', sort: true, edit: 'text'}">排序</th>
                    <th lay-data="{fixed: 'right', width:258, align:'center', toolbar: '#barOptionImg'}"></th>
                </tr>
                </thead>
            </table>


        </div>
        <!--------------------------子数据-图片-列表--------------------------->
        <!--------------------------子数据-图片-列表--------------------------->

        <!--------------------------子数据-文件-列表--------------------------->
        <!--------------------------子数据-文件-列表--------------------------->
        <div class="layui-tab-item">
            <form class="layui-form">
                <div class="searchTable">
                    搜索：
                    <div class="layui-inline">
                        <input class="layui-input" name="name" id="fsname" placeholder="名称、描述" autocomplete="off">
                    </div>
                    <div class="layui-inline">
                        <input class="layui-input" name="dir" id="fsdir" placeholder="路径" autocomplete="off">
                    </div>

                    <div class="layui-inline">
                        <select name="type" lay-search="" id="fstype">
                            <option value="" selected></option>
                            <option value="image">image</option>
                            <option value="audio">audio</option>
                            <option value="vidio">vidio</option>
                            <option value="compress">compress</option>
                            <option value="document">document</option>
                            <option value="other">other</option>
                        </select>
                    </div>
                    <button class="layui-btn" lay-submit lay-filter="submitFileBtn" id="submitFileBtn"
                            data-type="reload">搜索
                    </button>
                </div>
            </form>
            <!--数据列表-->
            <table class="layui-table" lay-data="{url:'', id:'filelist',toolbar:'default'}" id="filelist2"
                   lay-filter="filelist">
                <thead>
                <tr>
                    <th lay-data="{type:'checkbox'}">ID</th>
                    <th lay-data="{field:'id', width:80, sort: true}">ID</th>
                    <th lay-data="{field:'name', width:200, sort: true, edit: 'text'}">名称</th>
                    <th lay-data="{field:'content', width:200, sort: true, edit: 'text'}">content</th>
                    <th lay-data="{field:'videourl',  minWidth: 200, edit: 'text'}">videourl</th>
                    <th lay-data="{field:'type', minWidth: 120}">type</th>
                    <th lay-data="{field:'size', minWidth: 120}">size</th>
                    <th lay-data="{field:'dir',  minWidth: 120}">路径</th>
                    <th lay-data="{field:'createdate', sort: true,maxWidth: 50, width:200}">创建时间</th>
                    <th lay-data="{field:'sortx', sort: true, edit: 'text'}">排序</th>
                    <th lay-data="{fixed: 'right', width:258, align:'center', toolbar: '#barOptionFile'}"></th>
                </tr>
                </thead>
            </table>

        </div>
        <!--------------------------子数据-文件-列表--------------------------->
        <!--------------------------子数据-文件-列表--------------------------->


        <!--------------------------子数据-文件-上传--------------------------->
        <!--------------------------子数据-文件-上传--------------------------->
        <div class="layui-tab-item" hidden>
            <div class="layui-upload">
                <button type="button" class="layui-btn layui-btn-normal" id="fileList">选择多文件</button>
                <div class="layui-upload-list">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>文件名</th>
                            <th>大小</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="uploadFileLists"></tbody>
                    </table>
                </div>
                <button type="button" class="layui-btn" id="fileListAction">开始上传</button>
            </div>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <!--                <legend>绑定原始文件域</legend>-->
            </fieldset>

            <input type="file" name="myfiles" id="uploadFile" enctype="multipart/form-data" style="display: none;">


        </div>
        <!--------------------------子数据-文件-上传--------------------------->
        <!--------------------------子数据-文件-上传--------------------------->

        <!--------------------------子数据-其他--------------------------->
        <div class="layui-tab-item">
            <div id="sliderDemo" style="margin: 50px 20px;">

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">actionIds</label>
                    <div class="layui-input-block">
                        <textarea name="content" id="actionIds" placeholder="actionIds" style="height: 250px;"
                                  class="layui-textarea"></textarea>
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">字段提示</label>
                    <div class="layui-input-block">
                        <textarea name="content" id="字段提示" placeholder="字段提示" style="height: 150px;"
                                  class="layui-textarea">category01 content parent_id</textarea>
                    </div>
                </div>


                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">actionField</label>
                    <div class="layui-input-block">
                        <input type="text" name="actionField" placeholder="actionField" id="actionField" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">actionValue</label>
                    <div class="layui-input-block">
                        <input type="text" name="actionValue" placeholder="actionValue" id="actionValue" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">action</label>

                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="action" lay-search="" id="action">
                                <option value="update">update</option>
                            </select>
                        </div>
                    </div>
                </div>
                <button class="layui-btn" lay-filter="submitBtn" id="actionSubmit" hidden>提交操作</button>
                <button class="layui-btn" lay-filter="submitBtn" id="actionVideo" hidden>视频</button>
            </div>
        </div>
    </div>
    <!----------------------------tab内容-------------------------------->

</div>
<!-------------------------------tab-------------------------------->
<!-------------------------------tab-------------------------------->

<!---------------------------主数据-列表-按钮--------------------------->
<script type="text/html" id="barOption">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">下级</a>
    <a class="layui-btn layui-btn-xs" lay-event="keys">关键词</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="upload">上传</a>
</script>

<!---------------------------子数据-列表-按钮--------------------------->
<script type="text/html" id="barOptionDetail">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="opendown">打开下级</a>
</script>

<!---------------------------子数据-文件-头-按钮--------------------------->
<script type="text/html" id="toolbarFile">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="uploadzip">打包下载</button>
        <button class="layui-btn layui-btn-sm" lay-event="update">操作区</button>
        <button class="layui-btn layui-btn-sm" lay-event="delete">删除</button>
    </div>
</script>

<!---------------------------子数据-图片-列表-按钮--------------------------->
<script type="text/html" id="barOptionImg">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="show">查看</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="download">下载</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="upload">上传</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="video">播放</a>

</script>

<!---------------------------子数据-文件-列表-按钮--------------------------->
<script type="text/html" id="barOptionFile" >
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="show">查看</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="download">下载</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="upload">上传</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="video">播放</a>
</script>


<script src="/layuiadmin/layui/layui.js"></script>
<script src="/bus/list.js"></script>
<script src="/bus/upDataMain/list.js"></script>
<script src="/bus/utils/util.js"></script>

<script>
    layui.config({
        //version: '{{lay.version}}' //为了更新 js 缓存
    });

    //监听Tab切换
    element.on('tab(demo)', function (data) {
        // layer.tips('切换了 ' + data.index + '：' + this.innerHTML, this, {
        //     tips: 1
        // });
    });

    //主数据刷新
    function shuxin() {
        var cfpid = parent.fpid;

        if (!isStrNull(cfpid)) {
            $("#parent_id").val(cfpid);
            setTimeout("doooo()", 300);
            return;
        }
        $("#submitBtn2").click();
    }


    function doooo() {
        var cfpid = parent.fpid;
        $("input[name='parent_id']").val(cfpid);
        $("#parent_id").val(cfpid);
        $("#submitBtn2").click();
    }

    //主数据条件查询
    form.on('submit(submitBtn2)', function (data) {
        rangeType = $("#rangeTypes").val();
        rangeStr = $("#rangeStrs").val();
        rangeField = $("#rangeFields").val();
        console.log("rangeType " + rangeType + " rangeStr " + rangeStr + "  rangeField " + rangeField)
        var mysearch = {
            "upDataMain": data.field,
            "sortType": sortType,
            "sortStr": sortStr,
            "rangeType": rangeType,
            "rangeStr": rangeStr,
            "rangeField": rangeField
        };
        console.log("mysearch" + mysearch);
        var mysearchs = JSON.stringify(mysearch);
        console.log("mysearchs" + mysearchs);
        searchdata(mysearchs);
        return false;
    });

    //监听工具条 主数据
    table.on('tool(tmlist)', function (obj) {
        var data = obj.data;
        if (obj.event === 'detail') {//下级
            //layer.msg('ID：' + data.id + ' 的查看操作');
            toEdit = {"parent_id": data.id};
            myuid = data.id;
            showDetail(data.id);
        } else if (obj.event === 'keys') {//关键词
            // layer.alert('关键词：<br>' + JSON.stringify(data))
            myuid = data.id;
            openKeys(0);
        } else if (obj.event === 'upload') {//上传
            console.log(data.id);
            myuid = data.id;
            sendRequst("GET", "", "/tFile/uid/" + myuid)
            $("#fileList").click();
        }
    });

    //触发排序事件
    table.on('sort(tmlist)', function (obj) { //注：sort 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
        console.log(obj.field); //当前排序的字段名
        console.log(obj.type); //当前排序类型：desc（降序）、asc（升序）、null（空对象，默认排序）
        console.log(this); //当前排序的 th 对象
        sortType = obj.type;
        sortStr = obj.field;
        shuxin();
    });

    //关键词详情
    function openKeys(level) {
        levelx = level;
        layer.open({
            type: 2
            , title: '详细页'
            , content: "" + "/tKeyWeb/keys"//页面路径
            , maxmin: true
            , area: ['550px', '530px']
            , btn: ['确定', '取消']
            , yes: function (index, layero) {
                var keyssave = layero.find('iframe').contents().find("#keyssave");
                keyssave.click();
                reFresh();
                if (levelx == 2) {
                    showDetail(condition);
                }
            }
        });
    }

    //级联查询
    form.on('select(category01)', function (data) {
        var val = data.value;
        console.info($(data));//$("#category01s").find("option:selected").attr("myid");$("#category01").attr("myid")
        var v9 = $("#" + val).attr("myid");
        console.info("v9 " + v9);
        // 获取文本描述
        getTD(v9, 1);
    });
    form.on('select(category02)', function (data) {
        var val = data.value;
        var v9 = $("#" + val).attr("myid");
        console.info(v9);
        getTD(v9, 2);
    });

    //远程获取级联下拉单
    function getTD(condition, level) {
        var levell = level - 1;
        var leveln = level + 1;
        if (leveln == 1) {
            return;
        }
        if (condition == undefined || condition == "undefined" || condition == "待定") {
            cleanSeclect("category0" + leveln, leveln);
            return;
        }
        var rurlx = "/tDictionary/search/1/100";
        var datax = "{\"dpid\":\"" + condition + "\"}";
        var htmld = "<option value=></option>" +
            "<option value=\"待定\" >待定</option>";
        console.log(datax);
        $.ajax({
            url: rurlx,
            type: "POST",
            data: datax,
            contentType: "application/json;charset=utf-8",
            success: function (data) {
                var dlist = data.data.list;
                console.log(dlist);
                for (var d of dlist) {
                    htmld += "<option id=\"" + d.dvalue + "\" myid=\"" + d.id + "\" value=\"" + d.dvalue + "\" >" + d.dkey + "</option>";
                }
                $("#category0" + leveln).html(htmld);
                layui.use('form', function () {
                    var form = layui.form;//高版本建议把括号去掉，有的低版本，需要加()
                    form.render('select');
                });
            }
        });
    }

    //级联下拉清空
    function cleanSeclect(id, leveln) {
        //console.log(leveln);
        if (leveln == 4) {
            return;
        }
        var htmld = "<option value=></option>" +
            "<option value=\"待定\" >待定</option>";
        $("#" + id).html(htmld);
        form.render('select');
        if (leveln == 2 || leveln == "2") {
            cleanSeclect("category0" + (leveln + 1), 4);
        }
    }

    $(document).keydown(function (event) {
        var imgid = $("#myfangdaimg").attr("currImgid");
        if (event.keyCode == 37) {//为37时(即左方面键)
            var nextid = $("#" + imgid).parent().prev().find("img").attr("id");
            var nextimgsrc = $("#" + nextid).attr("src");
            $("#myfangdaimg").attr("src", nextimgsrc);
            $("#myfangdaimg").attr("currImgid", nextid);
        } else if (event.keyCode == 39) {//为39时(即右方面键)
            var nextid = $("#" + imgid).parent().next().find("img").attr("id");
            var nextimgsrc = $("#" + nextid).attr("src");
            $("#myfangdaimg").attr("src", nextimgsrc);
            $("#myfangdaimg").attr("currImgid", nextid);
        }
    });

    function toAddAction(datas, table) {
        if(actiontable!=table){
            $("#actionIds").val("");
            $("#actionIds").html("");
        }
        actiontable=table;
        var ids = $("#actionIds").val();
        for (var data of datas) {
            if(!isIdInActionIds(data.id)){
             ids += " " + data.id;
            }
        }
        $("#actionIds").val(ids);
        $("#actionIds").html(ids);
    }

    function isIdInActionIds(id) {
        var re = false;
        var ids = $("#actionIds").val().split(" ");

        for (var d of ids) {
            if (d == id) {
                re = true;
            }
        }
        return re;
    }

    $("#actionSubmit").click(function(){
       var ids=$("#actionIds").val();
       var actionField=$("#actionField").val();
       var actionValue=$("#actionValue").val();
       var action=$("#action").val();
        var senddata="{\"ids\":\"" + ids + "\",\"actionField\":\"" + actionField + "\",\"actionValue\":\"" + actionValue + "\",\"action\":\"" + action + "\",\"actiontable\":\"" + actiontable + "\"}";
        console.log(senddata);
           // "{\"ids\":ids,\"actionField\":actionField,\"actionValue\":actionValue,\"action\":action,\"actiontable\":actiontable}";
        $.ajax({
            url: "/master/action",
            type: "POST",
            data: senddata,
            contentType: "application/json;charset=utf-8",
            success: function (data) {
                console.log(data);
            },
            error: function (data) {
                console.log('error');
            }
        });
    });

    $("#actionVideo").click(function(){
        openVideo();
    });
    function openVideo(url){
        layer.open({
            type: 2,
            title: false,
            area: ['630px', '360px'],
            shade: 0.8,
            closeBtn: 0,
            shadeClose: true,
           // content: '//player.youku.com/embed/XMzI1NjQyMzkwNA=='
            content: url
        });
    }

</script>

</body>
</html>
